<% form_for(@category, :url => (@category.id ? admin_category_path(@category) : admin_categories_path)) do |f| %>
  <%= f.error_messages %>

  <p>
    <%= f.label :name %><br />
    <%= f.text_field :name %>
  </p>
  <p>
    <%= f.label :parent_id %><br />
    <%= f.select :parent_id, format_categories_options(@parents, @category.parent_id) %>
  </p>
  <p>
    <%= f.submit 'Aanmaken' %>
  </p>
<% end %>